package com.cdvtc.flower.model;

import java.math.BigDecimal;

/**
 * 购物车明细项(不存库)
 */
public class CartItem {
	/**
	 * 商品
	 */
	private Products products;
	/**
	 * 商品数量
	 */
	private int quantity;

	/**
	 * 计算小记
	 */
	public BigDecimal getTotal() {
		return this.products.getSale_price().multiply(BigDecimal.valueOf(quantity));
	}


	public Products getProduct() {
		return products;
	}

	public void setProduct(Products products) {
		this.products = products;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	@Override
	public String toString() {
		return "CartItem{" +
				"products=" + products +
				", quantity=" + quantity +
				'}';
	}
}
